.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    background-color: #007bff;
    padding-top: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000; /* 新增：设置层级确保不被遮挡 */
}


.sidebar ul {
    list-style-type: none;
    padding: 0;
}

/* 修正子菜单定位基础元素 */
.sidebar li {
    position: relative;
    margin-bottom: 10px;
}

.sidebar a {
    display: block;
    padding: 15px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
}

.sidebar a:hover {
    background-color: #023e8a;
    transform: scale(1.02);
}

.sidebar a.active {
    background-color: #0056b3;
}

/* 优化子菜单显示样式 */

/* 修复悬停显示逻辑 */

/* 新增：鼠标移出时保持子菜单显示（可选增强体验） */

.submenu li {
    width: 100%;
}

.submenu a {
    padding: 12px 20px;
    white-space: nowrap;
}

.submenu a:hover {
    background-color: #023e8a;
}

.content-container {
    margin-left: 200px;
    padding: 20px;
    min-height: 100vh;
}

.content {
    display: none;
}

.content.active {
    display: block;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000; /* 新增：设置层级确保不被遮挡 */
}

.topbar .device-info-topbar {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    padding: 8px 15px;
    border-radius: 20px;
    margin-left: auto;
    margin-right: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

#system-runtime {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    padding: 5px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    margin-left: auto;
    font-size: 14px;
    margin-right: 20px;
}

.time-display {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 5px 10px;
    margin-right: 10px;
    transition: backdrop-filter 0.3s ease, background 0.3s ease;
}

.time-display:hover {
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.9);
}

.divider {
    position: fixed;
    left: 200px;
    top: 0;
    width: 1px;
    height: 100%;
    background-color: #ddd;
}

/* 新增日志页面样式 */
.log-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.log-count {
    padding: 8px 12px;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.download-btn, .clear-btn {
    padding: 8px 15px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.download-btn:hover {
    background: rgba(0,0,0,0.2);
}

.clear-btn:hover {
    background: rgba(255,0,0,0.3);
}

.database-management {
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
    margin: 30px 0;
    max-width: 600px;
}

.database-form label {
    font-size: 18px;
    margin-bottom: 15px;
}

.database-form input {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
}

.database-form button {
    background-image: linear-gradient(to right, #0069e0, #007bff);
    padding: 12px 20px;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.database-form button:hover {
    background-image: linear-gradient(to right, #0056b3, #0069e0);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

#redis-status {
    padding: 12px;
    font-size: 14px;
    border: 1px solid transparent;
    border-left: 4px solid;
}
